package getsmart.project.main;

import java.io.ByteArrayOutputStream;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Bitmap.CompressFormat;


	public class Utilities {
	    public static byte[] getBytes(Bitmap bitmap) {
	        ByteArrayOutputStream stream = new ByteArrayOutputStream();
	        bitmap.compress(CompressFormat.JPEG, 0, stream);
	        return stream.toByteArray();
	    }
	
		public static Bitmap getImage(byte[] image) {
		        return BitmapFactory.decodeByteArray(image, 0, image.length);
		}

}
